package com.whiteape.book.ui.base;

/**
 * Created by newbiechen on 17-4-25.
 */

public abstract class BaseRVMVPFragment<T extends BaseContract.BasePresenter, D extends BaseRVFragment.Movable> extends BaseRVFragment<D> implements BaseContract.BaseView{

    protected T mPresenter;

    protected abstract T bindPresenter();

    @Override
    protected void startLogic(){
        mPresenter = bindPresenter();
        mPresenter.attachView(this);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        if (mPresenter != null) {
            mPresenter.detachView();
        }
    }
}
